#pragma once

#include <iostream>
#include <cmath>
#include <vector>
#include <stack>
#include <set>
#include <utility>
#include <sstream>
#include <opencv.hpp>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>

using namespace std;

/* 
* GrahamImplementation.h 
* Created on: 2010-10-25 
* Author: codesmuggler 
* Website: http://codesmuggler.com 
*/

class GrahamImplementation 
{
	public:
		GrahamImplementation() {};
		// this method does the job - 
		// given vector of points return convex hull  
		CvPoint* compute(std::vector<CvPoint> points, int& nVertex, std::vector<CvPoint> &result);
		
	private:  
		// conve hull points  
		std::stack<CvPoint> cstack;  
		std::vector<CvPoint> points;  
		// orient point taking 2 points from the top of the points cstack  
		double counter_clock_wise(CvPoint p);
};